package cn.tedu.springboot01;

import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.stereotype.Component;

@Component
@ConditionalOnBean(User.class)
@ConditionalOnMissingBean(Phone.class)
public class MusicPhone implements Phone{
    public MusicPhone(){
        System.out.println("MusicPhone的构造方法被调用了");
    }

    @Override
    public String toString() {
        return "【音乐手机】";
    }
}
